package com.jiangruan.javainspect.service;

import com.alibaba.fastjson.JSONObject;
import com.jiangruan.javainspect.Constants;
import com.jiangruan.javainspect.bean.Idioncommon;
import com.jiangruan.javainspect.request.HttpUtils;

/**
 * @author:liyaqi
 * @email:3441520483@qq.com
 * @desc:
 * @datatime: 2021/12/27 17:27
 */
public class GetIdiom {
    public Idioncommon getidiom(String idiom){
String URl = Constants.IDIOM_URL
        + "?key=" +Constants.IDIOM_KEY
        + "&wd=" + idiom;
        String result = HttpUtils.get(URl);
        System.out.println(result);
        Idioncommon idioncommon = JSONObject.parseObject(result, Idioncommon.class);
        return idioncommon;
    }
}
